#ifndef THREAD_POOL_H
#define THREAD_POOL_H

#include "event_loop.h"
#include "event_loop_thread.h"

struct thread_pool
{
    struct event_loop *main_loop;
    int started;    // 是否启动
    int thread_num; // 线程个数
    struct event_loop_thread *loop_threads;
    int position; // 轮询位置
};

struct thread_pool *thread_pool_new(struct event_loop *main_loop, int thread_num);

void thread_pool_start(struct thread_pool *);

struct event_loop *thread_pool_get_loop(struct thread_pool *);

#endif